package com.tocean.app.util.id;

import java.security.SecureRandom;
import java.util.UUID;

public class UUIDGenerate {

    private static SecureRandom random = new SecureRandom();

    /**
     * 封装JDK自带的UUID, 通过Random数字生成
     */
    public static String getUUIDString() {
        return UUID.randomUUID().toString();
    }

    /**
     * 封装JDK自带的UUID, 通过Random数字生成, 中间无-分割.
     */
    public static String getShortUUIDString() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    /**
     * 使用SecureRandom随机生成Long.
     */
    public static Long randomLong() {
        return Math.abs(random.nextLong());
    }

}
